#include"vector.h"
#include<string>
using namespace std;
void test1()
{
	hjq::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.reserve(10);
	for (int i = 0; i < 4; i++)
	{
		cout << v1[i] << " ";
	}
	v1.pop_back();
	v1.pop_back();
	cout << endl;
	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;
	v1.resize(15, 6);
	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;
}

void test2()
{
	hjq::vector<int> v1(5, 0);
	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;
    hjq::vector<int> v2(v1);
	for (auto x : v2)
	{
		cout << x << " ";
	}
	cout << endl;
	hjq::vector<int> v3;
	v3 = v2;
	for (auto x : v2)
	{
		cout << x << " ";
	}
	cout << endl;
	cout << v3.size() << " " << v3.capacity() << endl;
}

void test3()
{
	string s1("abcdefg");
	string::iterator begin = s1.begin();
	string::iterator end = s1.end();
	hjq::vector<char> v1(begin,end);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
}

void test4()
{
	hjq::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.insert(v1.begin(), 9);
	v1.insert(v1.begin(), 8);
	v1.insert(v1.begin(), 7);
	v1.insert(v1.begin(), 6);
	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;
	v1.erase(v1.begin());
	v1.erase(v1.begin());
	v1.erase(v1.begin());
	v1.erase(v1.begin());
	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;
}

void test5()
{
	string s1("afdsf");
	hjq::vector<string> v;
	v.push_back(s1);
}

int main()
{
	//test1();
	//test2();
	//test3();
	//test4();
	test5();
	return 0;
}